package com.hunlian.makelove.tools;

import android.util.Base64;

/**
 * Created by zealjiang on 2016/7/4 09:24.
 * Email: zealjiang@126.com
 */
public class Base64EncodeDecode {

    public static String encodeBase64String(String str) throws Exception {
        return Base64.encodeToString(str.getBytes(), Base64.DEFAULT);
    }

    public static String decoderBase64(String base64Code) throws Exception {

        byte[] buffer =Base64.decode(base64Code, Base64.DEFAULT);
        String str = new String(buffer);

        return str;
    }

}
